<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="cn.firstsoft.firstframe.admin.PropertyFile"%>
<%@ page import="org.springside.core.Constants" %>
<%@ page import="java.io.*,java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>管理控制台 - 环境设置 - 动态密码卡集成</title>
<%@ include file="/common/meta2.jsp"%>
<link href="../style.css" type="text/css" rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
	<table width="100%" align="center" >
		<TR>
			<TH class=listViewPaginationTdS1  align=left colSpan=4>
			设置动态密码卡结果
			</TH>
		</TR>	
		<tr>
			<td widht="100%">
<%
	//得到当前的短信厂商


	String provider = request.getParameter("provider");
	if (provider == null) provider = "false";
	
	PropertyFile.writeProperties("firstframe.properties", "plugins.dynamic", provider);
	out.println("<br>完成修改文件：firstframe.properties");		

	if ("true".equals(provider)) {
		String dbtype = request.getParameter("dbtype");
		if (dbtype == null) dbtype = "2";
		String dbserver = request.getParameter("dbserver");
		if (dbserver == null) dbserver = "localhost";
		String dbport = request.getParameter("dbport");
		if (dbport == null) dbport = "1433";
		String dbname = request.getParameter("dbname");
		if (dbname == null) dbname = "seamoon";	
		String dbuser = request.getParameter("dbuser");
		if (dbuser == null) dbuser = "sa";
		String dbpassword = request.getParameter("dbpassword");
		if (dbpassword == null) dbpassword = "";	
					
		PropertyFile.writeProperties("plugins/webconfig.properties", "dbtype", dbtype);
		PropertyFile.writeProperties("plugins/webconfig.properties", "dbserver", dbserver);
		PropertyFile.writeProperties("plugins/webconfig.properties", "dbport", dbport);
		PropertyFile.writeProperties("plugins/webconfig.properties", "dbname", dbname);
		PropertyFile.writeProperties("plugins/webconfig.properties", "dbuser", dbuser);
		PropertyFile.writeProperties("plugins/webconfig.properties", "dbpassword", dbpassword);
		out.println("<br>完成海月设置！");		
	}
%>
<BR>
设置成功后，需要重新启动服务器！<a href="dynamic.jsp">返回设置页面</a>
			</td>
		</tr>
	</table>
</body>
</html>
